home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / program / prgrssbr.lha / TestBar.s < prev   
Text File  |  1996-01-28  |  2KB  |  124 lines

  1.     Section    TestWindow,CODE
  2.     Opt    !
  3.  
  4.     IncDir    Include:
  5.     Include    mysystem.i
  6.  
  7. WindowX    Equ    25
  8. WindowY    Equ    25
  9. WindowWidth    Equ    160
  10. WindowHeight    Equ    60
  11.  
  12. BarType    Equ    1    ;0 is normal
  13.             ;1 is bevel
  14.  
  15. ;-----------------------------------------------------------------------
  16. Start:    Move.L    $4.w,_EXECBase
  17.  
  18.     Lea    (INTUILibrary,PC),A1
  19.     Moveq    #0,D0
  20.     CALL    OpenLibrary,EXEC
  21.     Move.L    D0,_INTUIBase
  22.     Beq    CloseDown
  23.  
  24.     Lea    (GRAPHLibrary,PC),A1
  25.     Moveq    #0,D0
  26.     CALL    OpenLibrary,EXEC
  27.     Move.L    D0,_GRAPHBase
  28.     Beq    CloseDown
  29.     
  30.     Lea    (TestWindow,PC),A0
  31.     Sub.L    A1,A1
  32.     CALL    OpenWindowTagList,INTUI
  33.     Move.L    D0,_WindowHandle
  34.     Beq    CloseDown
  35.  
  36.     Move.L    D0,A0        ;window
  37.  
  38.     Moveq    #10,D0        ;bar x
  39.     Moveq    #10,D1        ;bar y
  40.     Move.L    #WindowWidth-30,D2    ;bar width
  41.     Move.L    #WindowHeight-40,D3    ;bar height
  42.  
  43.     Bsr    BuildBar
  44.  
  45. ;-----------------------------------------------------------------------
  46. MainLoop:    Tst.B    D5
  47.     Beq.S    CloseDown
  48.  
  49.     Bsr    UpdateBar
  50.  
  51.     Move.L    (_WindowHandle,PC),A3
  52.     Move.L    (wd_UserPort,A3),A0
  53.     CALL    WaitPort,EXEC
  54.  
  55. .MsgLoop    Move.L    (wd_UserPort,A3),A0
  56.     CALL    GetMsg
  57.     Tst.L    D0
  58.     Beq.S    MainLoop
  59.  
  60.     Move.L    D0,A1
  61.     Move.L    (im_Class,A1),D4    ;class
  62.  
  63.     CALL    ReplyMsg
  64.  
  65.     Cmp.L    #CLOSEWINDOW,D4        ;type of message
  66.     Sne.B    D5
  67.     Bra.S    .MsgLoop
  68.  
  69. ;-----------------------------------------------------------------------
  70. CloseDown:    Move.L    (_WindowHandle,PC),A0
  71.     Cmp.L    #0,A0
  72.     Beq.S    .NoWindow
  73.     CALL    CloseWindow,INTUI
  74. .NoWindow
  75.     Move.L    (_GRAPHBase,PC),A1
  76.     Cmp.L    #0,A1
  77.     Beq.S    .NoGraph
  78.     CALL    CloseLibrary,EXEC
  79. .NoGraph
  80.     Move.L    (_INTUIBase,PC),A1
  81.     Cmp.L    #0,A1
  82.     Beq.S    .NoIntui
  83.     CALL    CloseLibrary,EXEC
  84. .NoIntui
  85.     Clr.L    D0
  86.     Rts
  87.  
  88. ;-----------------------------------------------------------------------
  89.     IFD    BarType
  90.     Include    BevelBar.s
  91.     ELSE
  92.     Include    NormalBar.s
  93.     ENDC
  94.  
  95. ;-----------------------------------------------------------------------
  96. WindowTitle:    Dc.B    'Test Window',0
  97. INTUILibrary:    INTUITIONNAME
  98. GRAPHLibrary:    GRAPHICSNAME
  99.     EVEN
  100.  
  101. TestWindow:    Dc.W    WindowX
  102.     Dc.W    WindowY
  103.     Dc.W    WindowWidth
  104.     Dc.W    WindowHeight
  105.     Dc.B    -1
  106.     Dc.B    -1
  107.     Dc.L    IDCMP_CLOSEWINDOW|IDCMP_MOUSEBUTTONS
  108.     Dc.L    WFLG_CLOSEGADGET|WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_ACTIVATE|WFLG_RMBTRAP|WFLG_NOCAREREFRESH|WFLG_GIMMEZEROZERO
  109.     Dc.L    0
  110.     Dc.L    0
  111.     Dc.L    WindowTitle
  112.     Dc.L    0
  113.     Dc.L    0
  114.     Dc.W    0
  115.     Dc.W    0
  116.     Dc.W    0
  117.     Dc.W    0
  118.     Dc.W    WBENCHSCREEN
  119.  
  120. _EXECBase:    Dc.L    0
  121. _INTUIBase:    Dc.L    0
  122. _GRAPHBase:    Dc.L    0
  123. _WindowHandle:    Dc.L    0
  124.